package tutorial.model.dbtest;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

import tutorial.model.access.Person;

public class DBTest {
	
	public static void main(String args[]) {
		EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestModel", new java.util.HashMap<String, String>());
		EntityManager em = emf.createEntityManager();
		em.getTransaction().begin();
		
		Person person = new Person("test", "test", "test");
		person.setDescription("Das ist eine Beschreibung die diesen User beschreiben soll!");
		
		em.persist(person);
		
		em.getTransaction().commit();
		
		em.close();
		emf.close();
	}
}